package cn.bdqn.t354.service;

import cn.bdqn.t354.entity.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@SpringBootTest
@RunWith(SpringRunner.class)
public class UserServiceTester {
    @Resource
    UserService userService;

    @Test
    public void test(){
        User user = userService.getUser(2l);
        System.out.println(user.getUsrName());
    }

    @Test
    public void testUpdate(){
        User user=new User();
        user.setUsrId(2l);
        user.setUsrName("dajunjun");
        userService.updateUser(user);
    }

    @Test
    public void testDelete(){
        userService.deleteUser(2l);
    }

    @Test
    public void testAdd(){
        User user=new User();
        user.setUsrName("dajunjun");
        userService.addUser(user);
    }
}
